package com.xzx.springmvc.controller;

import com.xzx.springmvc.service.HelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.PostConstruct;

/**
 * @author xinzhixuan
 * @version 1.0
 * @date 2025/5/11 12:16
 */
@Controller
public class HelloController {
    @Autowired
    private HelloService helloService;

    @ResponseBody
//    @RequestMapping(value = "/hello", method = {RequestMethod.GET})
    @GetMapping(value = "/hello")
    public String sayHello(String name) {
        return helloService.sayHello(name);
    }
}
